package FactoryMethodModel;

/**
 * @program: DesignModeProject
 * @description: 简单工厂模式（披萨类）
 * @author: Li canzhang
 * @create: 2022-04-19 15:32
 **/
//将披萨类做成抽象类
public abstract class Pizza {
    protected String name;

    //准备不同的披萨原材料是不一样的，所以做成抽象方法，供子类具体实现
    public abstract void prepare();

    public void bake(){
        System.out.println(name + "bakeing;");
    }

    public void cut(){
        System.out.println(name + "cuting;");
    }

    public void box(){
        System.out.println(name + "boxing;");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public String toString() {
        return "Pizza{" +
                "name='" + name + '\'' +
                '}';
    }
}
